<template>
  <view class="qentry">
    <!-- <li v-for="item in items" :key="item.message">
    {{ item.message }}
  </li> -->
    <view
      v-for="(item, index) in list"
      :key="index"
      class="home-section"
      @tap="() => toView(item)"
    >
      <image :src="item.icon" alt="" srcset="" class="home-section-img" />
      {{ item.text }}
    </view>
  </view>
</template>

<script>
import "./index.scss";
import Vue from "vue";
import Taro from "@tarojs/taro";
import icon1 from "../../../../assets/icon/icon1.png";
import icon2 from "../../../../assets/icon/icon2.png";
import icon3 from "../../../../assets/icon/icon3.png";
import icon4 from "../../../../assets/icon/icon4.png";
import icon5 from "../../../../assets/icon/icon5.png";
import icon6 from "../../../../assets/icon/icon6.png";
import icon7 from "../../../../assets/icon/icon7.png";
import icon8 from "../../../../assets/icon/icon8.png";

export default {
  data() {
    return {
      list: [
        {
          icon: icon1,
          text: "党建活动",
          path: "/pages/culture/index",
          typeId: "5c46cf73b5773c375f1a8285",
        },
        {
          icon: icon2,
          text: "同心桥",
          path: "/pages/culture/index",
          typeId: "5c46cf7eb5773c375f1a8286",
        },
        {
          icon: icon3,
          text: "微心愿",
          path: "/pages/tinywish/index",
          // typeId: "5c46cf86b5773c375f1a8287",
        },
        { icon: icon4, text: "商圈商户", path: "/pages/merchantlist/index" },
        { icon: icon5, text: "消费券", path: "/pages/consumer/index" },
        { icon: icon6, text: "初心家", path: "/pages/beginhome/index",},
        { icon: icon7, text: "电子地图", path: "/pages/map/index" },
        {
          icon: icon8,
          text: "志愿者",
          path: "/pages/culture/index",
          typeId: "5c46cf8db5773c375f1a8288",
        },
      ],
    };
  },

  methods: {
    toView(item) {
      console.log(item, item.path);
      // Taro.navigateTo({ url: '/pages/thread_detail/thread_detail' })
      Taro.navigateTo({ url: `${item.path}?typeId=${item.typeId || ""}` });
    },
  },
};
// Taro.navigateTo({ url: '/pages/thread_detail/thread_detail' })
</script>
